package com.kfm.pm.pet;

public class Host {
    public void goHospital(Pet pet) {
        pet.toHospital();
    }

    public Pet donateAnimal(String type) {
        Pet pet = null;
        if ("dog".equals(type)) {
            pet = new Dog();
        } else if ("bird".equals(type)) {
            pet = new Bird();
        } else {
            pet = new Pet();
        }
        return pet;
    }

}
